package com.main.tripplanner.persistent;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="country")
public class Country extends PersistentEntity{
	private String name;
	

	@Id
	@Column(name="country_id")
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	@Column(name="name")
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@Override
	public boolean equals(Object o) {
		if(o == null)
			return false;
		if(!(o instanceof Country))
			return false;
		Country otherCountry = (Country) o;
		if(!(otherCountry.getName().equals(this.getName())))
			return false;
		return true;
	}
	
}
